import { request } from "@/utils/http"
import {getHosListSearchParamsType,hospitalListReqReturnType,getHosProvinceReturnType,getHosListDetailReturnType} from './model/hospitalListTypes'

//获取分页列表
export const getHosListRequset = (page:number,limit:number,searchParams:getHosListSearchParamsType) => {
    return request.get<any,hospitalListReqReturnType>(`/admin/hosp/hospital/${page}/${limit}`,{
        params:searchParams
    })
}

//获取省份
export const getHosProvinceRequest = () => {
    return request.get<any,getHosProvinceReturnType>('/admin/cmn/dict/findByDictCode/province')
}

//获取市
export const getHosCityOrdistrictRequest = (parentId:string) => {
    return request.get<any,getHosProvinceReturnType>(`/admin/cmn/dict/findByParentId/${parentId}`)
}

//获取医院详情
export const getHosListDetailRequest = (id:string) => {
    return request.get<any,getHosListDetailReturnType>(`/admin/hosp/hospital/show/${id}`)
}

//更新状态
export const updateHosStatusRequest = (id:string,status:0|1) => {
    return request.get<any,null>(`/admin/hosp/hospital/updateStatus/${id}/${status}`)
}